<html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <script>

    </script>
</head>

<body>
<div id="div">正则表达式的用法</div>
<script>
    var reg = new RegExp("e")
    document.write(reg.test("hello world"))//匹配就返回true 不匹配返回false
    document.write("\n")
    document.write(reg.exec("hello world"))
</script>
</body>
</html>